package com.mapper.helping;

import com.domain.Issue;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 大忽悠
 * @since 2022年02月08日
 */
public interface IssueMapper extends BaseMapper<Issue> {
    @Update("UPDATE issue i SET i.like_sum=i.like_sum+#{num} WHERE i.id=#{issue_id}")
    boolean likeAdd(@Param("issue_id") Integer issue_id, @Param("num") int num);

    @Update("UPDATE issue SET is_deleted=1 WHERE id=#{issue_id}")
    Boolean logicDelTargetQuestion(Integer issue_id);

    @Update("UPDATE issue SET hot=hot-#{hot}")
    boolean reduceHot(@Param("hot") Integer issue_hour_reduce_hot);

    @Update("UPDATE issue SET  is_audited=1 where id=#{issue_id}")
    Boolean passIssue(@Param("issue_id") Integer issue_id);
}
